<?php
namespace Admin\Controller;
use Think\Controller;
class BaseController extends Controller{
public function _initialize(){
if(ACTION_NAME!='index' && ACTION_NAME!='checkLog'){
   $this->checkLog();
} 

}

private  function checkLog(){
if(!session("?flag")){
$this->error('无权限访问此页',U('Admin/Index/index'));
}
}
}
?>